package com.example.swagger.endpoint;

import com.example.swagger.dto.UserDto;
import com.example.swagger.model.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangxing
 * @date 2018-07-31 11:19
 **/
@Api(tags = "用户组接口", description = "简易的Swagger接口文档")
@RestController
@RequestMapping(value = "/group", produces = {"application/json", "application/xml"})
public class GroupEndpoint {
    @ApiOperation(value = "查询用户组")
    @GetMapping(value = "/message")
    public ResponseEntity<User> getUser(UserDto user) {
        return ResponseEntity.ok(new User(user.getId(), user.getName(), "", "查询用户"));
    }
}
